package com.yc.forum.servlet;

import com.yc.forum.dao.PostDao;
import com.yc.forum.dao.ProblemDao;
import com.yc.forum.util.Utils;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

@WebServlet(name = "HotProblemServlet",value="/HotProblem.s")
public class HotProblemServlet extends HttpServlet {
    private ProblemDao problemdao=new ProblemDao();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        List<Map<String,Object>> list= problemdao.selectHotProblem();
        Utils.toJson(list,response);
    }
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }


}
